#include <WinTen.h>
#include <Windows.h>
#include <CommDlg.h>
#include <ClipApi.h>

//----------------------------------------------------------------------------//

CLIPPER GetPrintDC()
{
   PRINTDLG pd;

   _bset( ( BYTE * ) &pd, 0, sizeof( PRINTDLG ) );

   pd.lStructSize = sizeof( PRINTDLG );
   pd.hwndOwner   = _parni( 1 );
   pd.Flags       = PD_RETURNDC;

   _retni( PrintDlg( &pd ) ? pd.hDC: 0 );
}

//----------------------------------------------------------------------------//

CLIPPER StartDOC()
{
   DOCINFO info;

   info.cbSize      = sizeof( DOCINFO );
   info.lpszDocName = _parc( 2 );
   info.lpszOutput  = _parc( 3 );

   _retni( StartDoc( _parni( 1 ),       // hDC printer device
                     &info ) );
}

//----------------------------------------------------------------------------//

CLIPPER EndDOC()
{
   _retni( EndDoc( _parni( 1 ) ) );     // hDC printer device
}

//----------------------------------------------------------------------------//

CLIPPER StartPAGE()
{
   _retni( StartPage( _parni( 1 ) ) );  // hDC printer device
}

//----------------------------------------------------------------------------//

CLIPPER EndPAGE()
{
   _retni( EndPage( _parni( 1 ) ) );    // hDC printer device
}

//----------------------------------------------------------------------------//
